
<?php
include 'koneksiDB.php';

$q = strtolower($_GET["q"]);

$seminggulagi=date("Y-m-d",strtotime("+1 week"));
if($q==1){    $qpengolahan = "SELECT * FROM datatimeline where kode_bidang='3'  and kode_seksi='5' and tanggal > '".$seminggulagi."' ORDER BY tanggal desc";
    }else{    $qpengolahan = "SELECT * FROM datatimeline where kode_bidang='3'  and kode_seksi='5' and tanggal < '".date('Y-m-d')."' ORDER BY tanggal desc";
    }
     $rpengolahan = $conn->query($qpengolahan);

if ($rpengolahan->num_rows > 0) {

    // output data of each row
    while ($rows = $rpengolahan->fetch_assoc()) {

        echo "<div class='cd-timeline-block'>";
        echo "<div class='cd-timeline-img'></div>";
        echo "<div class='cd-timeline-content'>";
        echo "<h2>" . $rows['tema'] . "</h2>";
        echo "<p>" . $rows['rincian'] . "</p>";
        echo "<p>";

        if ($rows['status'] == 1) {
            echo 'status: terlaksana';
        } else {
            echo 'status: belum terlaksana';
        }
        echo "</p>";
        echo '<span class="cd-date">' . $rows['tanggal'] . '</span>';
        echo '</div></div> ';
    }
} else {
    
}

$conn->close();
?>
